From: Keir Fraser Date: Thu, 7 Feb 2008 18:00:44 +0000 (+0000) Subject: x86_emulate: Fix MUL emulation. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14317^2~67 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=785137cb6b2ebfa54bfb6af5d985ac10fa8a4560;p=xen.git x86_emulate: Fix MUL emulation. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/x86_emulate.c b/xen/arch/x86/x86_emulate.c index ee0118a7b3..c111f1ca36 100644 --- a/xen/arch/x86/x86_emulate.c +++ b/xen/arch/x86/x86_emulate.c @@ -1710,11 +1710,14 @@ x86_emulate( switch ( src.bytes ) { case 1: + dst.val = (uint8_t)dst.val; dst.val *= src.val; if ( (uint8_t)dst.val != (uint16_t)dst.val ) _regs.eflags |= EFLG_OF|EFLG_CF; + dst.bytes = 2; break; case 2: + dst.val = (uint16_t)dst.val; dst.val *= src.val; if ( (uint16_t)dst.val != (uint32_t)dst.val ) _regs.eflags |= EFLG_OF|EFLG_CF; @@ -1722,6 +1725,7 @@ x86_emulate( break; #ifdef __x86_64__ case 4: + dst.val = (uint32_t)dst.val; dst.val *= src.val; if ( (uint32_t)dst.val != dst.val ) _regs.eflags |= EFLG_OF|EFLG_CF;